package com.huangliusong.hlsinspringboot.bootstrap;

import com.huangliusong.hlsinspringboot.repository.MyFirstLevelRepository;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;

@ComponentScan(basePackages = "com.huangliusong.hlsinspringboot.repository")
public class RepositoryBootstrap {
    public static void main(String[] args){
        ConfigurableApplicationContext context=new SpringApplicationBuilder(RepositoryBootstrap.class)
                .web(WebApplicationType.NONE )
                .run(args );

        MyFirstLevelRepository myFirstLevelRepository=context.getBean("myFirstLevelRepository",MyFirstLevelRepository.class);
        System.out.println(myFirstLevelRepository);
        context.close();
    }
}
